{extend name="public/base" /} {block name="body"}
<div class="content-tabs">
	<ol class="breadcrumb">
		<li>
			<a href="{:url('web/index/index')}"><i class="fa fa-home"></i></a>
		</li>
		<li>
			<strong>出库管理</strong>
		</li>
	</ol>
</div>
<div class="ibox float-e-margins">
	<div class="ibox-content">
		<form id="myForm" class="form-horizontal m-t" method="post" action="{:url('placing')}">	
			<div class="form-group" style="padding-left: 20px;">
					单号 <input type="text" id="log_sn" name="log_sn" value="" placeholder="请输入出库单号" class="bank" />
	     			<select name="stocktype" class="bank" id="stocktype" >
						<option value="0">全部类型</option>
						<option value="3" >销售出库</option>	
						<option value="4" >其他出库</option>
					</select>
					出库时间 <input id='start_time' name='start_time' style="width: 160px;" onclick='WdatePicker()' type='text' placeholder="开始时间" class="bank" />	
					至<input id='end_time' name='end_time'  style="width: 160px;" onclick='WdatePicker()' type='text' placeholder="结束时间" class="bank" />
					<span class="bank"><button type="submit" class="btn btn-sm btn-primary"><li class="fa fa-search"> 查询</li></button> </span>
			</div>
		</from>
		<a href="{:url('stockmake',['type'=>2])}" class="btn btn-xs btn-primary">制作出库单</a>
            <div class="example-wrap">
				<div class="example">				
					<table class="table table-bordered table-hover">
						<thead>
							<tr class="long-th">    
                            	<th>类型</th>
                                <th>单号</th>
                                <th>制单人</th>
                                <th>时间</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody id="list" style="text-align: center;">
                        	{volist name="list" id="vo"}
                        	   <tr>
                        	   	<td>
                        	   		{if $vo.stocktype == 3}
                        	   		销售出库
                        	   		{elseif $vo.stocktype == 4}
                        	   		其他出库
                        	   		{/if}
                        	   	</td>
                        	   	<td>{$vo.sn}</td>
                        	   	<td>{$vo.czy}</td>   
                        	   	<td>{$vo.add_time}</td>                        	   		
								<td>
									<a onclick="stocklist('{$vo.sn}','{$vo.id}')" class="btn btn-primary bnt-sm">
										<i class="fa fa-paste"></i> 明细</a>                  	   		
                        	   	</td>
                        	   </tr>
                        	{/volist}
                        </tbody>
                    </table>
                    <div style="text-align: right;">
                    	{$list->render()}
                    </div>
                </div>
            </div>
            </div>
</div>
{/block} {block name="script"}
<script src="__LIB__/datepicker/WdatePicker.js"></script>
<script>
	//出库单明细
	function stocklist(sn,id){
		layer.open({		
	  	type: 2, 
	  	id: "stocklist",
	 	area: ['850px', '450px'] ,
	 	title: '出库单明细',
	 	scrollbar: false,
	  	content: '/web/stock/stocklist?type=2&sn='+sn+'&id='+id //这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
		}); 
	}
</script>
<style>
.bank{
	width: 150px;
    height:30px;
    text-align:center;
    border-radius:5px;
}
</style>
{/block}